﻿@model NTQOnlineExamFrontend.Models.BasketViewModel

<div class="panel panel-red">
    @*<div class="panel-heading">Panel red</div>*@
    <div class="panel-body">
        <label>You have <span class="title"> ( @(Model.BasketItems != null ? @Model.BasketItems.Count : 0) )
                        </span> items in your cart</label>
        <table class="table table-bordered">
            @*<thead>
                <tr>
                    <th>3 items to buy</th>
                    <th>Price</th>
                </tr>
            </thead>*@
            <tbody>

                @if (Model.BasketItems != null)
                {
                    foreach (var item in Model.BasketItems)
                    {
                    <tr rel="@item.Id">
                        <td>
                            <div class="item">
                                @item.TermName
                            </div>
                        </td>
                        <td class="float-right">@item.Price.ToString("#.## AUD")</td>
                    </tr>
                    
                    }
                }
                <tr>
                    <td>
                        <div class="item">
                            <strong>Sub total</strong>
                        </div>
                    </td>
                    <td class="float-right"><strong>@Model.TotalPrice.ToString("#.## AUD")</strong></td>
                </tr>


            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#basket-qty').html(@(Model.BasketItems != null ? @Model.BasketItems.Count : 0));
    });
</script>
